Package edu.claflin.finder.io.graph
Class SIFGraphIO
java.lang.Object
edu.claflin.finder.io.graph.SIFGraphIO
- All Implemented Interfaces:
GraphReader,GraphWriter
A class for reading and writing graphs in the SIF format.
The SIF, or Simple Interaction File, format is outlined in detail here:
- Version:
- 3.1.1 February 2, 2016
- Author:
- Charles Allen Schultz II
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseGraph(File source, boolean undirected) Reads a graph from memory.private static booleanTests to see if a File is a valid graph file.voidwriteGraph(Graph toWrite) Writes graphs to memory.
-
Constructor Details
-
SIFGraphIO
public SIFGraphIO()
-
-
Method Details
-
parseGraph
Reads a graph from memory. Reads SIF Style graphs.- Specified by:
parseGraphin interfaceGraphReader- Parameters:
source- the File object representing the graph in memory.undirected- This boolean is IGNORED as SIF graphs are NOT undirected.- Returns:
- the read Graph
-
writeGraph
Writes graphs to memory. Writes SIF Style graphs.- Specified by:
writeGraphin interfaceGraphWriter- Parameters:
toWrite- the Graph object to write to memory.
-
testFile
Tests to see if a File is a valid graph file. Currently only tests by checking to ensure the provided file is not a directory.- Parameters:
file- the File to test.- Returns:
- the boolean value representing if the file is valid.
-